<!DOCTYPE html>
<html>
<head>
    <title>Member</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link  href="<?php echo base_url();?>css/admin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<?php echo base_url();?>js/jquery/jquerylib.js"></script>
    <!-- JS2CAL -->
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/jscal2/jscal2.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/jscal2/border-radius.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/jscal2/steel/steel.css" />
    <script type="text/javascript" src="<?php echo base_url();?>js/jscal2/jscal2.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>js/jscal2/lang/th.js"></script>
    
    <script type="text/javascript">
    $(document).ready(function() {
        $("#issame").click(function(){
			if(this.checked){
				$(".addrreg").each(function(){
					
					$(this).attr("disabled","disabled");
					$(this).val('');
				});
			}
			else{
				$(".addrreg").each(function(){
				$(this).removeAttr("disabled");
				
			});
			}
        });

        $('#province').show();
 		$('#province').val("");
 		var createProvince = '<select id="dropdown_province">';
 		createProvince += '<option value="0">กรุณาเลือกจังหวัด</option>';
 		$.get('<?=site_url('land/allprovince');?>', function(data) {
 			$.each($.parseJSON(data), function() {
	             createProvince += '<option value="'+this.PROVINCE_ID +'">'+this.PROVINCE_NAME	+'</option>';
			 });
			createProvince += '</select>';
			$('#province').html(createProvince);
			   $('#dropdown_province').change(function() {	
			   	//amphur
			   	$('#amphur').show();
			   	$('#amphur').val("");
			
			   		$.get('<?=site_url('land/allprovince');?>',{provinceid:$('#dropdown_province').val()}, function(data) {
			   			   	var createAmphur = '<select id="dropdown_amphur">';
 				createAmphur += '<option value="0">กรุณาเลือกอำเภอ</option>';
	     				$.each($.parseJSON(data), function() {
	     					//alert(this.AMPHUR_ID );
			             	createAmphur += '<option value="'+this.AMPHUR_ID +'">'+this.AMPHUR_NAME	+'</option>';
						 });
						  createAmphur += '</select>';
					
						 $('#amphur').html(createAmphur);
						   $('#dropdown_amphur').change(function() {	
			 
			   				$('#district').show();
						   	$('#district').val("");
						   		$.get('<?=site_url('land/allprovince');?>',{amphurid:$('#dropdown_amphur').val()}, function(data) {
						   			  	var createDistrict = '<select id="dropdown_district">';
						 				createDistrict += '<option value="0">กรุณาเลือกเขต</option>';
							     				$.each($.parseJSON(data), function() {
							     		
									             	createDistrict += '<option value="'+this.DISTRICT_ID +'">'+this.DISTRICT_NAME	+'</option>';
												 });
												  createDistrict += '</select>';
											
												 $('#district').html(createDistrict);
						   		});
						   });
									 
						 //district
					 });
					
			   });
 		});
        
    });
      	
    
    </script>
    
</head>
<body>
 <div id="contentright">
        <div id="search">
          <div id="searchblank">
            <div id="searchinput">
             Welcome, admin
            </div>
          
            <div id="advancesearch"><a href="#" class="advancesearch">Logout</a></div>
          </div>
        </div>
        </div>
    <div id="main">
       <?php 
        $menu['nowmenu'] = 'members';
        $this->load->view('common/divheader',$menu);
        ?>
        <div id="middle">
        <div id="breadcrumbs"><a href="dashboard.html">Dashboard</a>/ สมาชิก</div>
            <?php $this->load->view('users/divleftmenu');?>
            <div id="center-column">
                <div class="top-bar">
                   
                    <h1>Members Registration form</h1>
                    <p>&nbsp;</p>
                    
              </div>
              
              <div class="table">
                    <table class="listing form" cellpadding="0" cellspacing="0">
                        <tr>
                            <th class="full" colspan="2">ข้อมูลเกษตรกร</th>
                        </tr>
                        <tr>
                            <td width="172"><strong>ชื่อ</strong></td>
                            <td><input name="vfirstname" type="text" class="text" value="<?=isset_or($vfirstname,'');?>" required/></td>
                        </tr>
                        <tr>
                            <td><strong>นามสกุล</strong></td>
                            <td><input name="vlastname" type="text" class="text" value="<?=isset_or($vfirstname,'');?>" required/></td>
                        </tr>
                        <tr>
                            <td><strong>เพศ</strong></td>
                            <td><p>
                            	
                                <input name="vgender" type="radio" value="ชาย" <?php echo isset_or($vgender)=='ชาย'?'checked':'';  ?> required/>ชาย
								<input name="vgender" type="radio" value="หญิง" <?php echo isset_or($vgender)=='หญิง'?'checked':'';  ?> required/>หญิง

                              <br>
                          </p></td>
                        </tr>
                        <tr>
                            <td><strong>วันเกิด</strong></td>
                            <td><input name="vbirthdate" size="30" id="f_date1" data-default-value="yyyy-mm-dd" value="<?=isset_or($vbirthdate,'');?>" required/>
          <button id="f_btn1">...</button><br />

    <script type="text/javascript">//<![CDATA[
      Calendar.setup({
        inputField : "f_date1",
        trigger    : "f_btn1",
        onSelect   : function() { this.hide() },
        dateFormat : "%Y-%m-%d",
        max		   : <?php echo date('Ymd');?>,
        bottomBar	: false
      });
    //]]></script></td>
                        </tr>
                    </table>
                </div>
                 <div class="table">
                    <table class="listing form" cellpadding="0" cellspacing="0">
                        <tr>
                            <th class="full" colspan="2">ข้อมูลการเป็นสมาชิก</th>
                        </tr>
                        <tr>
                            <td width="172"><strong>ประเภทสมาชิก</strong></td>
                            <td>
                              <select name="vtype" required>
      			<?php 
      			foreach ($type_option as $eachtype):
      			?>
      				<option value="<?=$eachtype['typeid'];?>" <?=($eachtype['typeid']==isset_or($vtype,''))?'selected':'';?> ><?=$eachtype['typename'];?></option>

      			<?php 
      			endforeach;
      			?>
          </select>
                            </td>
                        </tr>
                        <tr>
                            <td><strong>หมู่บ้าน</strong></td>
                            <td><select name="village" id="" required>
            	<option value="" >หมู่บ้าน</option>
      			<?php 
      			foreach ($village_option as $eachoption):
      			?>
      				<option value="<?=$eachoption['villageid'];?>" <?=($eachoption['villageid']==isset_or($village,''))?'selected':'';?> ><?=$eachoption['villagename'];?></option>

      			<?php 
      			endforeach;
      			?>
          </select></td>
                        </tr>
                    </table>
                </div>
                
                <div class="table">
                    <table class="listing form" cellpadding="0" cellspacing="0">
                        <tr>
                            <th class="full" colspan="4">ที่อยู่ติดต่อ</th>
                        </tr>
                        <tr>
                            <td width="25%"><strong>
                              <label for="hno">บ้านเลขที่</label>
                              <input name="housenum" type="text" value="<?=isset_or($housenum,'');?>" size="10"/>
                            </strong></td>
                          <td width="25%"><strong>หมู่ 
                            <input name="moono" type="text" value="<?=isset_or($moono,'');?>" size="10"/>
                          </strong></td>
                            <td width="25%"><strong>ซอย
                            <input name="soi" type="text" value="<?=isset_or($soi,'');?>" size="15"/>
                          </strong></td>
                            <td width="25%"><strong>ถนน
                           <input name="street" type="text" value="<?=isset_or($street,'');?>" size="15"/>
                            </strong></td>
                            
                      </tr>
                        <tr>
                            <td width="25%"><strong>จังหวัด 
                              <span id="province"><select id="dropdown_province"></select></span>
	
	
                            </strong></td>
                          <td width="172"><strong>อำเภอ 
                            <span id="amphur"><select id="dropdown_amphur"></select></span>
                          </strong></td>
                            <td width="172"><strong>ตำบล 
                              <span id="district"><select id="dropdown_district"></select></span>
                            </strong></td>
                            <td width="172"><strong>
                              	รหัสไปรษณีย์
                              <input name="zipcode" type="text" value="<?=isset_or($zipcode,'');?>" size="5">
                            </strong></td>
                            
                      </tr>
                         <tr>
                            <td><strong>โทรศัพท์บ้าน
                                <input name="vphone" value="<?=isset_or($vphone,'');?>" type="text" id="hno" size="10">
                            </strong></td>
                          <td><strong>มือถือ 
                              <input name="vmobile" value="<?=isset_or($vmobile,'');?>" type="text" id="hno2" size="10">
                          </strong></td>
                            <td><strong>แฟกซ์ 
                                <input name="vfax" type="text" id="hno3" size="15">
                            </strong></td>
                            <td width="172"><strong>อีเมล์
                                <input name="vemail" value="<?=isset_or($vemail,'');?>" type="text" id="hno6" size="15">
                            </strong></td>
                            
                      </tr>
                    </table>
                </div>
                 <div class="table">
                    <table class="listing form" cellpadding="0" cellspacing="0">
                        <tr>
                            <th class="full" colspan="4">ที่อยู่ตามทะเบียนบ้าน 
                              <input type="checkbox" name="issame" id="issame" value="issame">
                            <label for="hsame">เหมือนที่อยู่ปัจจุบัน</label></th>
                        </tr>
                        <tr>
                            <td width="25%"><strong>
                              <label for="hno">บ้านเลขที่</label>
                              <input name="vhousenum2" type="text" class="addrreg" size="10">
                            </strong></td>
                          <td width="25%"><strong>หมู่ 
                            <input name="vmoono2" type="text" class="addrreg" size="10">
                          </strong></td>
                            <td width="25%"><strong>ซอย
                                <input name="soi2" type="text" class="addrreg" size="15">
                          </strong></td>
                            <td width="25%"><strong>ถนน
                                <input name="vstreet2" type="text" class="addrreg" size="15">
                            </strong></td>
                            
                      </tr>
                        <tr>
                            <td width="25%"><strong>จังหวัด 
                              <select name="vprovince2" class="addrreg">
                                <option>1</option>
                                <option>2</option>
                                <option>3</option>
                                <option>4</option>
                              </select>
                            </strong></td>
                          <td width="172"><strong>อำเภอ 
                            <select name="vcity2" class="addrreg">
                              <option>1</option>
                            </select>
                          </strong></td>
                            <td width="172"><strong>ตำบล 
                              <select name="vdistrict2" class="addrreg">
                                <option>1</option>
                              </select>
                            </strong></td>
                            <td width="172"><strong>
                              รหัสไปรษณีย์
                              <input name="vzipcode2" type="text" class="addrreg" size="5">
                            </strong></td>
                            
                      </tr>
                       
                    </table>
                </div>
                  <div class="table">
                    <table class="listing form" cellpadding="0" cellspacing="0">
                        <tr>
                          <th class="full" colspan="2">หลักฐานประกอบการสมัคร</th>
                        </tr>
                        <tr>
                            <td width="40%"><strong>บัตรประชาชนเลขที่ 
                              <input name="idcard" type="text" id="hno7" size="13">
                            </strong></td>
                            <td><label for="citizen">ไฟล์สำเนาบัตรประชาชน</label>
                            <input type="file" name="file1" accept="image/*" /><br/>
                            <?php 
          	if (isset($file2)){
          		echo "<img src='$file2'/>";
          	}
          ?>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td><label for="citizen">ไฟล์สำเนาทะเบียนบ้าน</label>
                            <input type="file" name="file2" accept="image/*" /><br/>
                            <?php 
          	if (isset($file2)){
          		echo "<img src='$file2'/>";
          	}
          ?>
                            </td>
                        </tr>
                         <tr>
                            <td>&nbsp;</td>
                            <td><label for="citizen">ไฟล์อื่นๆ</label>
                            <input type="file" name="file3" accept="image/*" /><br/>
                            <?php 
          	if (isset($file3)){
          		echo "<img src='$file3'/>";
          	}
          ?>
                            </td>
                        </tr>
                    </table>
                </div>
              <div class="select-bar">
                    <p>
                      <label>
                        <input type="text" name="textfield" />
                      </label>
                      <label>
                        <input type="submit" name="Submit" value="บันทึก" />
                      </label>
                    </p>
              </div>
                
                
            </div>
            <div id="right-column">
                <strong class="h">Quick Link</strong>
                <div class="box">This is your admin home page. It will give you access to all things within the back end system that you will need to facilitate a smooth operation.</div>
            </div>
        </div>
        <div id="footer"><p>ALL RIGHTS RESERVED 2012 <a href="http://www.ubonbioethanol.com">UBON BIO ETHANOL CO., LTD.</a><br>Developed by DASH CO., LTD (2011-2012).  </p></div>
    </div>
</body>
</html>